#include<iostream>

using namespace std;

const int N = 35;
int dp[N][N];//传了i次 落在第j人手里的方案数

int main()
{
    int n , m;
    cin >> n >> m;
    dp[0][1] = 1;
    for(int i = 1;i <= m;i ++)
    {
        dp[i][1] = dp[i-1][n] + dp[i-1][2];
        for(int j = 2;j < n;j ++)
        {
            dp[i][j] = dp[i-1][j-1] + dp[i-1][j+1];
        }
        dp[i][n] = dp[i-1][1] + dp[i-1][n-1];
    }
    cout << dp[m][1] << endl;
    return 0;
}